package com.gl.battleship.web.test;

import junit.framework.TestCase;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.client.RestTemplate;

//@RunWith(SpringJUnit4ClassRunner.class)  
//@ContextConfiguration(locations={"classpath:integration-test-context.xml"})  
public class CopyOfTestRestBaseMIO {

//	@Autowired
//	public RestTemplate restTemplate;
//	private static final String LOGIN_URL = "http://localhost:9090/battleship-web/rest/login/juan/123456";
//	private static final String LOGIN_URL1 = "http://localhost:9090/battleship-web/rest/login/pepe/123456";
//	private static final String DECLARE_WAR = "http://localhost:9090/battleship-web/rest/declareWar/";
//	private static final String ACCEPT_WAR = "http://localhost:9090/battleship-web/rest/acceptWar/";
//	private static final String CREATE_FLEET = "http://localhost:9090/battleship-web/rest/createFleet/";
//	private static final String SHOOT = "http://localhost:9090/battleship-web/rest/shoot/";
//	
//	@Test
//	public void login(){
//		
////		String result = restTemplate.getForObject(LOGIN_URL, String.class);
////		assertTrue("The token should be starting with tocke", result.startsWith("token") );
//
//	}
//	
//	@Test
//	public void shoot(){
//		
//		String securityToken = restTemplate.getForObject(LOGIN_URL, String.class);
//		assertTrue("The token should be starting with tocke", securityToken.startsWith("token") );
//		
//		String securityToken1 = restTemplate.getForObject(LOGIN_URL1, String.class);
//		assertTrue("The token should be starting with tocke", securityToken1.startsWith("token") );
//		//error en la declaracion de parametros en OPPONET
//		String warToken = restTemplate.getForObject(DECLARE_WAR+securityToken+"/pepe", String.class);
//
//		restTemplate.getForObject(ACCEPT_WAR+securityToken1+"/"+warToken, String.class);
//		
//		String fleet = 		
//						"0000000000"+
//						"0000000000"+
//						"0000000000"+
//						"0333000000"+
//						"0000000000"+
//						"2000000000"+
//						"2000000000"+
//						"0000000000"+
//						"0000000000"+
//						"4444055555";
//		
//		String fleet1 = 		
//						"0000000000"+
//						"0000000000"+
//						"0000000000"+
//						"3330000000"+
//						"0000000000"+
//						"0000000000"+
//						"2000000000"+
//						"2000000000"+
//						"0000000000"+
//						"4444055555";
//		
//		restTemplate.getForObject(CREATE_FLEET+securityToken+"/"+warToken+"/"+fleet, String.class);
//		restTemplate.getForObject(CREATE_FLEET+securityToken1+"/"+warToken+"/"+fleet1, String.class);
//		String resultWater = restTemplate.getForObject(SHOOT+securityToken+"/"+warToken+"/0/a", String.class);
//		assertEquals("WATER", resultWater);
//		
//		String resultNotTurn = restTemplate.getForObject(SHOOT+securityToken+"/"+warToken+"/0/a", String.class);
//		assertEquals("Player is NOT TURN SHOOT", resultNotTurn);
//
//		
//	}
	

}
